type Language = "zh-CN" | "en";
function generateI18nMessages() {
	const messages: { [key in Language]?: Record<string, any> } | any = {};
	const modules = import.meta.glob(`./**/*.json`, {
		eager: true,
		import: "default"
	});
	//1. 遍历所有文件，获取语言代码，采用平铺的方式
	Object.keys(modules).forEach(key => {
		const moduleMessages = modules[key] as any;
		const [lang] = key.replace("./", "").replace(".json", "").split("/");
		if (!messages[lang]) {
			messages[lang] = {};
		}
		for (const key2 in moduleMessages) {
			messages[lang][key2] = moduleMessages[key2];
		}
	});
	return messages;
}
export default {
	fallbackLocale: "zh-CN",
	locale: "zh-CN",
	allowCompositions: true,
	pluralizationRules: {},
	messages: generateI18nMessages()
};
